
/**
 * dbdJS External Variables
 */
var dbdJS = {"controller":"tales","action":"viewPage","files":["common_js,jquery-1.3.1.js","common_js,jquery.ext.js","js,modalEffect.js","common_js,jquery.simplemodal.js","common_js,jquery.ajaxLoader.js","common_js,jquery.ajaxModal.js","common_js,jquery.metadata.js","common_js,jquery.checkMaster.js","common_js,ui.core.js","common_js,ui.sortable.js","common_js,jquery.fileUpload.js","common_js,jquery.audioRecorder.js","common_js,jquery.rte.js","common_js,jquery.bg9.js","common_js,jquery.overlabel.js","js,ajaxOptions.js","js,promptModal.js","js,rte.js","js,global.js","common_js,swfobject.js"]};
/**
 * dbdJS(/var/www/vhosts/littlebirdtales.com/dbdApp/cache/dbdJS.b51dab42c729412ec5d17602df87d56e.js)
 */

(function(){var
window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return this;}
if(typeof selector==="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])
selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem&&elem.id!=match[3])
return jQuery().find(selector);var ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return ret;}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))
return jQuery(document).ready(selector);if(selector.selector&&selector.context){this.selector=selector.selector;this.context=selector.context;}
return this.setArray(jQuery.makeArray(selector));},selector:"",jquery:"1.3.1",size:function(){return this.length;},get:function(num){return num===undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems,name,selector){var ret=jQuery(elems);ret.prevObject=this;ret.context=this.context;if(name==="find")
ret.selector=this.selector+(this.selector?" ":"")+selector;else if(name)
ret.selector=this.selector+"."+name+"("+selector+")";return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(typeof name==="string")
if(value===undefined)
return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}
return this.each(function(i){for(name in options)
jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)
value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!=="object"&&text!=null)
return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)
ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).clone();if(this[0].parentNode)
wrap.insertBefore(this[0]);wrap.map(function(){var elem=this;while(elem.firstChild)
elem=elem.firstChild;return elem;}).append(this);}
return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},push:[].push,find:function(selector){if(this.length===1&&!/,/.test(selector)){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret;}else{var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)?jQuery.unique(elems):elems,"find",selector);}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!==undefined)
this[expando]=null;});if(events===true)
this.find("*").andSelf().each(function(i){if(this.nodeType==3)
return;var events=jQuery.data(this,"events");for(var type in events)
for(var handler in events[type])
jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,jQuery.grep(this,function(elem){return elem.nodeType===1;})),"filter",selector);},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector))
return cur;cur=cur.parentNode;}});},not:function(selector){if(typeof selector==="string")
if(isSimple.test(selector))
return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector);else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector==="string"?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return!!selector&&this.is("."+selector);},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,'option'))
return(elem.attributes.value||{}).specified?elem.value:elem.text;if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)
return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one)
return value;values.push(value);}}
return values;}
return(elem.value||"").replace(/\r/g,"");}
return undefined;}
if(typeof value==="number")
value+='';return this.each(function(){if(this.nodeType!=1)
return;if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type))
this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)
this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value===undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,+i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild,extra=this.length>1?fragment.cloneNode(true):fragment;if(first)
for(var i=0,l=this.length;i<l;i++)
callback.call(root(this[i],first),i>0?extra.cloneNode(true):fragment);if(scripts)
jQuery.each(scripts,evalScript);}
return this;function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)
jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)
elem.parentNode.removeChild(elem);}
function now(){return+new Date;}
jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}
if(typeof target!=="object"&&!jQuery.isFunction(target))
target={};if(length==i){target=this;--i;}
for(;i<length;i++)
if((options=arguments[i])!=null)
for(var name in options){var src=target[name],copy=options[name];if(target===copy)
continue;if(deep&&copy&&typeof copy==="object"&&!copy.nodeType)
target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)
target[name]=copy;}
return target;};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)
window.jQuery=_jQuery;return jQuery;},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument);},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval)
script.appendChild(document.createTextNode(data));else
script.text=data;head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length===undefined){for(name in object)
if(callback.apply(object[name],args)===false)
break;}else
for(;i<length;)
if(callback.apply(object[i++],args)===false)
break;}else{if(length===undefined){for(name in object)
if(callback.call(object[name],name,object[name])===false)
break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}
return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))
value=value.call(elem,i);return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))
elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)
elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
callback.call(elem);for(var name in options)
elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}
if(jQuery(elem).is(":visible"))
getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}
return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}
if(name.match(/float/i))
name=styleFloat;if(!force&&style&&style[name])
ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))
name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle)
ret=computedStyle.getPropertyValue(name);if(name=="opacity"&&ret=="")
ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}
return ret;},clean:function(elems,context,fragment){context=context||document;if(typeof context.createElement==="undefined")
context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);if(match)
return[context.createElement(match[1])];}
var ret=[],scripts=[],div=context.createElement("div");jQuery.each(elems,function(i,elem){if(typeof elem==="number")
elem+='';if(!elem)
return;if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase();var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)
div=div.lastChild;if(!jQuery.support.tbody){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)
if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)
tbody[j].parentNode.removeChild(tbody[j]);}
if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem))
div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);elem=jQuery.makeArray(div.childNodes);}
if(elem.nodeType)
ret.push(elem);else
ret=jQuery.merge(ret,elem);});if(fragment){for(var i=0;ret[i];i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1)
ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));fragment.appendChild(ret[i]);}}
return scripts;}
return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)
return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&elem.parentNode)
elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)
throw"type property can't be changed";elem[name]=value;}
if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))
return elem.getAttributeNode(name).nodeValue;if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined;}
return elem[name];}
if(!jQuery.support.style&&notxml&&name=="style")
return jQuery.attr(elem.style,"cssText",value);if(set)
elem.setAttribute(name,""+value);var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}
if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+
(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}
return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}
name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)
elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval)
ret[0]=array;else
while(i)
ret[--i]=array[i];}
return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)
if(array[i]===elem)
return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(!jQuery.support.getAll){while((elem=second[i++])!=null)
if(elem.nodeType!=8)
first[pos++]=elem;}else
while((elem=second[i++])!=null)
first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}
return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)
if(!inv!=!callback(elems[i],i))
ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)
ret[ret.length]=value;}
return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")
ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret),name,selector);};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)
jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)
this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames,state){if(typeof state!=="boolean")
state=!jQuery.className.has(this,classNames);jQuery.className[state?"add":"remove"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)
this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)
this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}
var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)
id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])
jQuery.cache[id]={};if(data!==undefined)
jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])
break;if(!name)
jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)
elem.removeAttribute(expando);}
delete jQuery.cache[id];}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!q||jQuery.isArray(data))
q=jQuery.data(elem,type,jQuery.makeArray(data));else if(data)
q.push(data);}
return q;},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();if(!type||type==="fx")
fn=queue[0];if(fn!==undefined)
fn.call(elem);}});jQuery.fn.extend({data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)
data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}
if(data===undefined)
return jQuery.queue(this[0],type);return this.each(function(){var queue=jQuery.queue(this,type,data);if(type=="fx"&&queue.length==1)
queue[0].call(this);});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});}});(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;if(context.nodeType!==1&&context.nodeType!==9)
return[];if(!selector||typeof selector!=="string"){return results;}
var parts=[],m,set,checkSet,check,mode,extra,prune=true;chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
selector+=parts.shift();set=posProcess(selector,set);}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));set=Sizzle.filter(ret.expr,ret.set);if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
if(pop==null){pop=context;}
Expr.relative[cur](checkSet,pop,isXML(context));}}
if(!checkSet){checkSet=set;}
if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector);}
if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
if(extra){Sizzle(extra,context,results,seed);}
return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
if(!set){set=context.getElementsByTagName("*");}
return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound;while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not);if(!match){anyFound=found=true;}else if(match===true){continue;}}
if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
if(found!==undefined){if(!inplace){curLoop=result;}
expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
break;}}}
expr=expr.replace(/\s*,\s*/,"");if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr;}else{break;}}
old=expr;}
return curLoop;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var cur=elem.previousSibling;while(cur&&cur.nodeType!==1){cur=cur.previousSibling;}
checkSet[i]=typeof part==="string"?cur||false:cur===part;}}
if(typeof part==="string"){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){if(typeof part==="string"&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=typeof part==="string"?elem.parentNode:elem.parentNode===part;}}
if(typeof part==="string"){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName="done"+(done++),checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName="done"+(done++),checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"&&!isXML){return context.getElementsByName(match[1]);}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not){match=" "+match[1].replace(/\\/g,"")+" ";var elem;for(var i=0;(elem=curLoop[i])!=null;i++){if(elem){if(not^(" "+elem.className+" ").indexOf(match)>=0){if(!inplace)
result.push(elem);}else if(inplace){curLoop[i]=false;}}}
return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
match[0]="done"+(done++);return match;},ATTR:function(match){var name=match[1].replace(/\\/g,"");if(Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
if(match[2]==="~="){match[4]=" "+match[4]+" ";}
return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
return false;}}else if(Expr.match.POS.test(match[0])){return true;}
return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0==i;},eq:function(elem,i,match){return match[3]-0==i;}},filter:{CHILD:function(elem,match){var type=match[1],parent=elem.parentNode;var doneName=match[0];if(parent&&(!parent[doneName]||!elem.nodeIndex)){var count=1;for(var node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType==1){node.nodeIndex=count++;}}
parent[doneName]=count-1;}
if(type=="first"){return elem.nodeIndex==1;}else if(type=="last"){return elem.nodeIndex==parent[doneName];}else if(type=="only"){return parent[doneName]==1;}else if(type=="nth"){var add=false,first=match[2],last=match[3];if(first==1&&last==0){return true;}
if(first==0){if(elem.nodeIndex==last){add=true;}}else if((elem.nodeIndex-last)%first==0&&(elem.nodeIndex-last)/first>=0){add=true;}
return add;}},PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
return true;}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return match.test(elem.className);},ATTR:function(elem,match){var result=Expr.attrHandle[match[1]]?Expr.attrHandle[match[1]](elem):elem[match[1]]||elem.getAttribute(match[1]),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!match[4]?result:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);}
var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results;}
return array;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
return ret;};}
(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();form.innerHTML="<input name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
root.removeChild(form);})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
results=tmp;}
return results;};}
div.innerHTML="<a href='#'></a>";if(div.firstChild&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
return oldSizzle(query,context,extra,seed);};Sizzle.find=oldSizzle.find;Sizzle.filter=oldSizzle.filter;Sizzle.selectors=oldSizzle.selectors;Sizzle.matches=oldSizzle.matches;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context){return context.getElementsByClassName(match[1]);};}
function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem&&elem.nodeType){var done=elem[doneName];if(done){match=checkSet[done];break;}
if(elem.nodeType===1&&!isXML)
elem[doneName]=i;if(elem.nodeName===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem&&elem.nodeType){if(elem[doneName]){match=checkSet[elem[doneName]];break;}
if(elem.nodeType===1){if(!isXML)
elem[doneName]=i;if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
elem=elem[dir];}
checkSet[i]=match;}}}
var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument);};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.filter=Sizzle.filter;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;Sizzle.selectors.filters.hidden=function(elem){return"hidden"===elem.type||jQuery.css(elem,"display")==="none"||jQuery.css(elem,"visibility")==="hidden";};Sizzle.selectors.filters.visible=function(elem){return"hidden"!==elem.type&&jQuery.css(elem,"display")!=="none"&&jQuery.css(elem,"visibility")!=="hidden";};Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")";}
return Sizzle.matches(expr,elems);};jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)
matched.push(cur);cur=cur[dir];}
return matched;};jQuery.nth=function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])
if(cur.nodeType==1&&++num==result)
break;return cur;};jQuery.sibling=function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)
r.push(n);}
return r;};return;window.Sizzle=Sizzle;})();jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)
return;if(elem.setInterval&&elem!=window)
elem=window;if(!handler.guid)
handler.guid=this.guid++;if(data!==undefined){var fn=handler;handler=this.proxy(fn);handler.data=data;}
var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice().sort().join(".");var handlers=events[type];if(jQuery.event.specialAll[type])
jQuery.event.specialAll[type].setup.call(elem,data,namespaces);if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener)
elem.addEventListener(type,handle,false);else if(elem.attachEvent)
elem.attachEvent("on"+type,handle);}}
handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)
return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)=="."))
for(var type in events)
this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}
jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");if(events[type]){if(handler)
delete events[type][handler.guid];else
for(var handle in events[type])
if(namespace.test(events[type][handle].type))
delete events[type][handle];if(jQuery.event.specialAll[type])
jQuery.event.specialAll[type].teardown.call(elem,namespaces);for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener)
elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)
elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}
ret=null;delete events[type];}}});}
for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}
if(!elem){event.stopPropagation();if(this.global[type])
jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type])
jQuery.event.trigger(event,data,this.handle.elem);});}
if(!elem||elem.nodeType==3||elem.nodeType==8)
return undefined;event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}
event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle)
handle.apply(elem,data);if((!elem[type]||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)
event.result=false;if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}
this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent)
jQuery.event.trigger(event,data,parent,true);}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}
if(event.isImmediatePropagationStopped())
break;}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando])
return event;var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}
if(!event.target)
event.target=event.srcElement||document;if(event.target.nodeType==3)
event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)
event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}
if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))
event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)
event.metaKey=event.ctrlKey;if(!event.which&&event.button)
event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments);};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler);},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type))
remove++;});if(remove<1)
jQuery.event.remove(this,namespaces[0],liveHandler);}}}}};jQuery.Event=function(src){if(!this.preventDefault)
return new jQuery.Event(src);if(src&&src.type){this.originalEvent=src;this.type=src.type;}else
this.type=src;this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}
function returnTrue(){return true;}
jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e)
return;if(e.preventDefault)
e.preventDefault();e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e)
return;if(e.stopPropagation)
e.stopPropagation();e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!=this)
try{parent=parent.parentNode;}
catch(e){parent=this;}
if(parent!=this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}};jQuery.each({mouseover:'mouseenter',mouseout:'mouseleave'},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix);},teardown:function(){jQuery.event.remove(this,orig,withinElement);}};});jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length)
jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)
fn.call(document,jQuery);else
jQuery.readyList.push(fn);return this;},live:function(type,fn){var proxy=jQuery.event.proxy(fn);proxy.guid+=this.selector+type;jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);return this;},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this;}});function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];if(elem)
elems.push({elem:elem,fn:fn});}});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false)
stop=false;});return stop;}
function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".");}
jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery);});jQuery.readyList=null;}
jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);jQuery.ready();},false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);jQuery.ready();}});if(document.documentElement.doScroll&&typeof window.frameElement==="undefined")(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}
jQuery.ready();})();}
jQuery.event.add(window,"load",jQuery.ready);}
jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,"+"change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});jQuery(window).bind('unload',function(){for(var id in jQuery.cache)
if(id!=1&&jQuery.cache[id].handle)
jQuery.event.remove(jQuery.cache[id].handle.elem);});(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();div.style.display="none";div.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}
jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}
root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}
root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",arguments.callee);});div.cloneNode(true).fireEvent("onclick");}
jQuery(function(){var div=document.createElement("div");div.style.width="1px";div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div);});})();var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string")
return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}
var type="GET";if(params)
if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){params=jQuery.param(params);type="POST";}
var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")
self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);if(callback)
self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}
return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}
return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string")
s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))
s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))
s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}
if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)
s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}
if(head)
head.removeChild(script);};}
if(s.dataType=="script"&&s.cache==null)
s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}
if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}
if(s.global&&!jQuery.active++)
jQuery.event.trigger("ajaxStart");var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)
script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}
head.appendChild(script);return undefined;}
var requestDone=false;var xhr=s.xhr();if(s.username)
xhr.open(type,s.url,s.async,s.username,s.password);else
xhr.open(type,s.url,s.async);try{if(s.data)
xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)
xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}
if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");xhr.abort();return false;}
if(s.global)
jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);ival=null;if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");}}else if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}
status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(e){status="parsererror";}}
if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}
if(s.ifModified&&modRes)
jQuery.lastModified[s.url]=modRes;if(!jsonp)
success();}else
jQuery.handleError(s,xhr,status);complete();if(isTimeout)
xhr.abort();if(s.async)
xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)
setTimeout(function(){if(xhr&&!requestDone)
onreadystatechange("timeout");},s.timeout);}
try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}
if(!s.async)
onreadystatechange();function success(){if(s.success)
s.success(data,status);if(s.global)
jQuery.event.trigger("ajaxSuccess",[xhr,s]);}
function complete(){if(s.complete)
s.complete(xhr,status);if(s.global)
jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");}
return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)
jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223;}catch(e){}
return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url];}catch(e){}
return false;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")
throw"parsererror";if(s&&s.dataFilter)
data=s.dataFilter(data,type);if(typeof data==="string"){if(type=="script")
jQuery.globalEval(data);if(type=="json")
data=window["eval"]("("+data+")");}
return data;},param:function(a){var s=[];function add(key,value){s[s.length]=encodeURIComponent(key)+'='+encodeURIComponent(value);};if(jQuery.isArray(a)||a.jquery)
jQuery.each(a,function(){add(this.name,this.value);});else
for(var j in a)
if(jQuery.isArray(a[j]))
jQuery.each(a[j],function(){add(j,this);});else
add(j,jQuery.isFunction(a[j])?a[j]():a[j]);return s.join("&").replace(/%20/g,"+");}});var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}
jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;if(elemdisplay[tagName]){display=elemdisplay[tagName];}else{var elem=jQuery("<"+tagName+" />").appendTo("body");display=elem.css("display");if(display==="none")
display="block";elem.remove();elemdisplay[tagName]=display;}
this[i].style.display=jQuery.data(this[i],"olddisplay",display);}}
return this;}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none")
jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));this[i].style.display="none";}
return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();}):this.animate(genFx("toggle",3),fn,fn2);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)
return opt.complete.call(this);if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}
if(opt.overflow!=null)
this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))
e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}
if(parts[1])
end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)
this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)
if(timers[i].elem==this){if(gotoEnd)
timers[i](true);timers.splice(i,1);}});if(!gotoEnd)
this.dequeue();return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)
jQuery(this).dequeue();if(jQuery.isFunction(opt.old))
opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)
options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)
this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style)
this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))
return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}
t.elem=this.elem;if(t()&&jQuery.timers.push(t)==1){timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)
if(!timers[i]())
timers.splice(i--,1);if(!timers.length){clearInterval(timerId);}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)
if(this.options.curAnim[i]!==true)
done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")
this.elem.style.display="block";}
if(this.options.hide)
jQuery(this.elem).hide();if(this.options.hide||this.options.show)
for(var p in this.options.curAnim)
jQuery.attr(this.elem.style,p,this.options.orig[p]);this.options.complete.call(this.elem);}
return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}
return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null)
fx.elem.style[fx.prop]=fx.now+fx.unit;else
fx.elem[fx.prop]=fx.now;}}});if(document.documentElement["getBoundingClientRect"])
jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};else
jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);jQuery.offset.initialized||jQuery.offset.initialize();var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName)))
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}
if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible")
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevComputedStyle=computedStyle;}
if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static")
top+=body.offsetTop,left+=body.offsetLeft;if(prevComputedStyle.position==="fixed")
top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);return{top:top,left:left};};jQuery.offset={initialize:function(){if(this.initialized)return;var body=document.body,container=document.createElement('div'),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';rules={position:'absolute',top:0,left:0,margin:0,border:0,width:'1px',height:'1px',visibility:'hidden'};for(prop in rules)container.style[prop]=rules[prop];container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow='hidden',innerDiv.style.position='relative';this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop='1px';this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);this.initialized=true;},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();var top=body.offsetTop,left=body.offsetLeft;if(jQuery.offset.doesNotIncludeMarginInBodyOffset)
top+=parseInt(jQuery.curCSS(body,'marginTop',true),10)||0,left+=parseInt(jQuery.curCSS(body,'marginLeft',true),10)||0;return{top:top,left:left};}};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
return results;},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))
offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return null;return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+
num(this,"padding"+tl)+
num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+
num(this,"border"+tl+"Width")+
num(this,"border"+br+"Width")+
(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px");};});})();(function($){$.extend({cssFile:function(f,m){$('<link>').attr('href',f).attr('type','text/css').attr('rel','stylesheet').attr('media',m||'screen').appendTo('head');},isArray:function(arr){if(typeof arr=='object'){if(arr.constructor==Array){return true;}}
return false;},arrayMerge:function(){var a={};var n=0;var argv=$.arrayMerge.arguments;for(var i=0;i<argv.length;i++){if($.isArray(argv[i])){for(var j=0;j<argv[i].length;j++){a[n++]=argv[i][j];}
a=$.makeArray(a);}else{for(var k in argv[i]){if(isNaN(k)){var v=argv[i][k];if(typeof v=='object'&&a[k]){v=$.arrayMerge(a[k],v);}
a[k]=v;}else{a[n++]=argv[i][k];}}}}
return a;},count:function(arr){if($.isArray(arr)){return arr.length;}else{var n=0;for(var k in arr){if(!isNaN(k)){n++;}}
return n;}},log:function(msg){if(window.console)
console.log(msg);else
alert(msg);},trim:function(str){return str.replace(/^\s+|\s+$/g,'');},ltrim:function(str){return str.replace(/^\s+/,'');},rtrim:function(str){return str.replace(/\s+$/,'');}});$.fn.extend({serializeAssoc:function(){var o={aa:{},add:function(name,value){var tmp=name.match(/^(.*)\[([^\]]*)\]$/);if(tmp){var v={};if(tmp[2])
v[tmp[2]]=value;else
v[$.count(v)]=value;this.add(tmp[1],v);}
else if(typeof value=='object'){if(typeof this.aa[name]!='object'){this.aa[name]={};}
this.aa[name]=$.arrayMerge(this.aa[name],value);}
else{this.aa[name]=value;}}};var a=$(this).serializeArray();for(var i=0;i<a.length;i++){o.add(a[i].name,a[i].value);}
return o.aa;}});})(jQuery);var modalEffect={duration:50,fadeIn:function(dialog,callback){var that=this;dialog.overlay.fadeIn(this.duration,function(){dialog.window.show();if(dialog.header)
dialog.header.show();dialog.container.show();dialog.data.show();if($.isFunction(callback)){callback.apply(dialog,[dialog]);}});},fadeOut:function(dialog){dialog.window.hide();dialog.overlay.fadeOut(this.duration);}};(function($){$.modal=function(data,options){return $.modal.impl.init(data,options);};$.modal.close=function(){$.modal.impl.close(true);};$.fn.modal=function(options){return $.modal.impl.init(this,options);};$.modal.defaults={overlay:50,zIndexStart:2000,overlayId:'modalOverlay',overlayClass:'modalOverlay',overlayCss:{},windowId:'modalWindow',windowClass:'modalWindow',windowCss:{},headerId:'modalHeader',headerClass:'modalHeader',headerCss:{},containerId:'modalContainer',containerClass:'modalContainer',containerCss:{},dataClass:'modalData',windowTitle:'',windowTitleTag:'h3',header:false,close:true,closeTitle:'Close',closeClass:'modalClose',appendTo:'body',persist:false,onOpen:null,onShow:null,onClose:null};$.modal.impl={opts:null,dialog:{},dialogs:[],init:function(data,options){this.dialog={};this.opts=$.extend({},$.modal.defaults,options);if(typeof data=='object'){data=data instanceof jQuery?data:$(data);if(data.parent().parent().size()>0){this.dialog.parentNode=data.parent();if(!this.opts.persist){this.dialog.original=data.clone(true);}}}
else if(typeof data=='string'||typeof data=='number'){data=$('<div>').html(data);}
else{if(console){console.log('SimpleModal Error: Unsupported data type: '+typeof data);}
return false;}
this.dialog.data=data.addClass(this.opts.dataClass);data=null;this.create();this.open();this.dialogs.push(this.dialog);return this;},create:function(){var zStart=this.opts.zIndexStart+(1000*(this.dialogs.length||0));this.dialog.overlay=$('<div>').attr('id',this.opts.overlayId).addClass(this.opts.overlayClass).css($.extend(this.opts.overlayCss,{opacity:this.opts.overlay/100,height:'100%',width:'100%',position:'fixed',left:0,top:0,zIndex:zStart})).hide().appendTo(this.opts.appendTo);this.dialog.window=$('<div>').attr('id',this.opts.windowId).addClass(this.opts.windowClass).css($.extend(this.opts.windowCss,{overflow:'hidden',position:'fixed',zIndex:(zStart+100)})).hide().appendTo(this.opts.appendTo);if(this.opts.header){this.dialog.header=$('<div>').attr('id',this.opts.headerId).addClass(this.opts.headerClass).css(this.opts.headerCss).append(this.opts.windowTitle!=''?'<'+this.opts.windowTitleTag+'>'
+this.opts.windowTitle
+'</'+this.opts.windowTitleTag+'>':'').hide().appendTo(this.dialog.window);}
this.dialog.container=$('<div>').attr('id',this.opts.containerId).addClass(this.opts.containerClass).css($.extend(this.opts.containerCss,{overflow:'auto',height:'100%'})).hide().appendTo(this.dialog.window);if(this.opts.close){this.dialog.close=$('<a></a>').attr('id',this.opts.closeClass+(this.dialogs.length||0)).attr('title',this.opts.closeTitle).addClass(this.opts.closeClass).css({position:'absolute',zIndex:(zStart+200)}).append('<span>'+this.opts.closeTitle+'</span>').appendTo(this.opts.header?this.dialog.header:this.dialog.container);}
if($.browser.msie&&($.browser.version<7)){this.fixIE();}
this.dialog.container.append(this.dialog.data.hide());},bindEvents:function(){var modal=this;$(this.opts.close?this.dialog.close:'.'+this.opts.closeClass).click(function(e){e.preventDefault();modal.close();});$(document).unbind('keyup');$(document).keyup(function(e){key=e==null?event.keyCode:e.which;if(key==27){modal.close();}});},unbindEvents:function(){$(this.dialog.close).unbind('click');},fixIE:function(){var wHeight=$(document.body).height()+'px';var wWidth=$(document.body).width()+'px';this.dialog.overlay.css({position:'absolute',height:wHeight,width:wWidth});this.dialog.window.css({position:'absolute'});this.dialog.iframe=$('<iframe src="javascript:false;">').css($.extend(this.opts.iframeCss,{opacity:0,position:'absolute',height:wHeight,width:wWidth,zIndex:1000,width:'100%',top:0,left:0})).hide().appendTo('body');},open:function(){if(this.dialog.iframe){this.dialog.iframe.show();}
if($.isFunction(this.opts.onOpen)){this.opts.onOpen.apply(this,[this.dialog]);}
else{this.dialog.overlay.show();this.dialog.window.show();if(this.dialog.header)
this.dialog.header.show();this.dialog.container.show();this.dialog.data.show();}
this.bindEvents();if($.isFunction(this.opts.onShow)){this.opts.onShow.apply(this,[this.dialog]);}},close:function(external){if(!this.dialog.data){return false;}
if($.isFunction(this.opts.onClose)&&!external){this.opts.onClose.apply(this,[this.dialog]);this.finalClose();}
else{this.finalClose();}},finalClose:function(){if(this.dialog.parentNode){if(this.opts.persist){this.dialog.data.hide().appendTo(this.dialog.parentNode);}
else{this.dialog.data.remove();this.dialog.original.appendTo(this.dialog.parentNode);}}
else{this.dialog.data.remove();}
this.dialog.container.remove();if(this.dialog.header)
this.dialog.header.remove();this.dialog.window.remove();this.dialog.overlay.remove();if(this.dialog.iframe)
this.dialog.iframe.remove();this.unbindEvents();this.dialogs.pop();if(this.dialogs.length>0)
this.dialog=this.dialogs[this.dialogs.length-1];else
this.dialog={};}};})(jQuery);(function($){$.ajaxLoader=function(options){return $.ajaxLoader.impl.init(this,options);};$.ajaxLoader.show=function(){return $.ajaxLoader.impl.loading();};$.ajaxLoader.hide=function(){return $.ajaxLoader.impl.doneLoading();};$.ajaxLoader.bind=function(){return $.ajaxLoader.impl.bind();};$.ajaxLoader.unBind=function(){return $.ajaxLoader.impl.unBind();};$.ajaxLoader.defaults={bind:true,opacity:100,overlayId:'ajaxLoader',overlayClass:'ajaxLoader',overlayBg:'transparent',containerId:'ajaxLoaderBox',containerClass:'ajaxLoaderBox',imageId:'ajaxLoaderImg',imageClass:'ajaxLoaderImg',imageAlt:'Loading...',imageSrc:'/images/gfx/ajax_load_roller_ffffff_on_f26122.gif',imageW:16,imageH:16,appendTo:'#pageAll',zIndex:10000};$.ajaxLoader.impl={opts:{},overlay:{},div:{},msg:{},image:{},init:function(data,options){this.opts=$.extend({},$.ajaxLoader.defaults,options);this.overlay=$('<div>').attr('id',this.opts.overlayId).addClass(this.opts.overlayClass).css({opacity:this.opts.opacity/100,cursor:'wait',backgroundColor:this.opts.overlayBg,height:'100%',width:'100%',position:'fixed',left:0,top:0,display:'none',zIndex:this.opts.zIndex}).appendTo(this.opts.appendTo);this.div=$('<div>').attr('id',this.opts.containerId).addClass(this.opts.containerClass).css({position:'fixed',right:'0',bottom:'0',textAlign:'right',display:'none',minHeight:this.opts.imageH,padding:'3px',paddingLeft:this.opts.imageW+2,zIndex:(this.opts.zIndex+1)}).appendTo(this.overlay);this.image=$('<img>').attr('id',this.opts.imageId).attr('src',this.opts.imageSrc).attr('alt',this.opts.imageAlt).addClass(this.opts.imageClass).css({position:'absolute',left:0,top:'50%',marginTop:'-'+(this.opts.imageH/2)+'px'}).appendTo(this.div);this.msg=$('<span></span>').text(this.opts.imageAlt).appendTo(this.div);if(this.opts.bind)
this.bind();},bind:function(){var a=this;this.div.bind('ajaxStart',function(){a.loading();});this.div.bind('ajaxStop',function(){a.doneLoading();});},unBind:function(){this.div.unbind('ajaxStart');this.div.unbind('ajaxStop');},loading:function(){this.overlay.show();this.div.show();this.msg.show();this.image.show();},doneLoading:function(){this.image.hide();this.msg.hide();this.overlay.hide();}};})(jQuery);(function($){$.fn.ajaxModal=function(opts){return $.ajaxModal.impl.init(this,opts);};$.ajaxModal=function(links,opts){return $.ajaxModal.impl.init($(links),opts);};$.ajaxModal.open=function(href,title,opts){return $.ajaxModal.impl.quickOpen(href,title,opts);};$.ajaxModal.refresh=function(){return $.ajaxModal.impl.refresh();};$.ajaxModal.replace=function(url){return $.ajaxModal.impl.replace(url);};$.ajaxModal.center=function(dialog){return $.ajaxModal.impl.center(dialog);};$.ajaxModal.bindCloseRefresh=function(){return $.ajaxModal.impl.bindCloseRefresh();};$.ajaxModal.getHref=function(){return $.ajaxModal.impl.getHref();};$.ajaxModal.defaults={size:'full',event:'click',boundClass:'ajaxModalBound',appendTo:'#pageAll',overlay:80,header:true,windowTitle:"",windowHref:"",windowLinkElem:{},closeOther:false,autoCenter:false,autoCenterTop:0.5,onOpen:modalEffect.fadeIn,onClose:modalEffect.fadeOut};$.ajaxModal.defaults.full={overlayId:'modalOverlay',overlayClass:'modalOverlay',windowId:'modalWindow',windowClass:'modalWindow',headerId:'modalHeader',containerId:'modalContainer',dataClass:'modalData'};$.ajaxModal.defaults.small={overlayId:'smallModalOverlay',overlayClass:'smallModalOverlay',windowId:'smallModalWindow',windowClass:'smallModalWindow',headerId:'smallModalHeader',containerId:'smallModalContainer',dataClass:'smallModalData'};$.ajaxModal.defaults.mini={overlayId:'miniModalOverlay',overlayClass:'miniModalOverlay',windowId:'miniModalWindow',windowClass:'miniModalWindow',headerId:'miniModalHeader',containerId:'miniModalContainer',dataClass:'miniModalData'};$.ajaxModal.impl={modal:{},init:function(links,opts){var a=this;var o=this.setOpts(opts);links.not('.'+o.boundClass).not('.disabled').bind(o.event,function(e){e.preventDefault();if(this.href.indexOf('#')!=-1)
return a.modal;o.windowHref=this.href;o.windowTitle=this.title;o.windowLinkElem=this;a.open(o);}).addClass(o.boundClass);return this.modal;},setOpts:function(opts){var o=$.extend({},$.ajaxModal.defaults,opts);switch(o.size)
{case'mini':o=$.extend({},$.ajaxModal.defaults.mini,o);break;case'small':o=$.extend({},$.ajaxModal.defaults.small,o);break;case'full':default:o=$.extend({},$.ajaxModal.defaults.full,o);break;}
return o;},quickOpen:function(href,title,opts){opts=this.setOpts(opts);opts.windowHref=href;opts.windowTitle=title;opts.windowLinkElem={};this.open(opts);return this.modal;},open:function(o){var a=this;if(o.closeOther)
$.modal.close();if(o.replaceOther&&typeof a.modal.dialog!="undefined"&&typeof a.modal.dialog.window!="undefined")
return a.replace(o.windowHref);if(o.autoCenter&&o.onOpen==$.ajaxModal.defaults.onOpen&&!($.browser.msie&&($.browser.version<7))){o.onOpen=function(dialog){modalEffect.fadeIn(dialog,function(){$(window).bind('resize',function(){$.ajaxModal.center(dialog);});$(window).resize();});}}
$.get(o.windowHref,function(data){a.modal=$('<div>').html(data).modal(o);a.modal.dialog.window.bind('refresh',function(e){$.get(a.modal.opts.windowHref,function(data){a.modal.dialog.container.children('div').html(data);if($.isFunction(a.modal.opts.onShow)){a.modal.opts.onShow.apply(a.modal,[a.modal.dialog]);}});});});},refresh:function(){return this.modal.dialog.window.trigger('refresh');},replace:function(url){this.modal.opts.windowHref=url;return this.modal.dialog.window.trigger('refresh');},bindCloseRefresh:function(){if(this.modal.dialog.close.hasClass('refreshBound')){return false;}
var a=this;var old=null;if($.isFunction(this.modal.opts.onClose)){old=this.modal.opts.onClose;}
this.modal.opts.onClose=function(dialog){if($.isFunction(old)){old.apply(a.modal,[a.modal.dialog]);}
window.location.reload();};this.modal.dialog.close.addClass('refreshBound');},getHref:function(){return this.modal.opts.windowHref;},center:function(d){if(d){var top=($(window).height()-d.window.outerHeight())*this.modal.opts.autoCenterTop;var pos='fixed';if(top<0){$(document).scrollTop(0);top=$(document).scrollTop();pos='absolute';}
d.window.css({top:top+'px',position:pos});}}};})(jQuery);(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)
data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
data=attr;}
if(data.indexOf('{')<0)
data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);(function($){$.fn.checkAllMaster=function(children,callback,inverse){if(callback&&!inverse&&!$.isFunction(callback)){inverse=callback;callback=null;}
var master=this;var children=$(children).not(this).filter('input[@type=checkbox]');this.click(function(){var masterState=this.checked;children.each(function(){this.checked=inverse&&masterState?!masterState:masterState;});});children.click(function(){var allChecked=this.checked;var anyChecked=this.checked;$(children).each(function(){if(!this.checked)
allChecked=false;else
anyChecked=true;});master.get(0).checked=inverse?!anyChecked:allChecked;if($.isFunction(callback)){callback.apply(master,[allChecked,anyChecked]);}});};$.fn.checkAll=function(not){this.each(function(){var n=$(this).filter('input[@type=checkbox]:not(:checked)');if(not)n=n.not(not);n.each(function(){this.checked=true;});});return this;};$.fn.unCheckAll=function(not){this.each(function(){var n=$(this).filter('input[@type=checkbox]:checked');if(not)n=n.not(not);n.each(function(){this.checked=false;});});return this;};$.fn.checkToggle=function(not){this.each(function(){var n=$(this).filter('input[@type=checkbox]');if(not)n=n.not(not);n.each(function(){this.checked=!this.checked;});});};$.fn.checkRadio=function(not){this.each(function(){var n=$(this).filter('input[@type=checkbox]');if(not)n=n.not(not);n.click(function(){$('input[@name='+this.name+']').unCheckAll(this);});});};})(jQuery);;jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.7.1",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;$.attr=function(elem,name,value){var set=value!==undefined;return(name=='role'?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)));};$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""));}):removeAttr.call(this,name));};}
$.fn.extend({remove:function(){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});return _remove.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods);}
var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'));}
return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this;}
if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(event,key,value){if(event.target==element){return self._setData(key,value);}}).bind('getData.'+name,function(event,key){if(event.target==element){return self._getData(key);}}).bind('remove',function(){return self.destroy();});};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled').removeAttr('aria-disabled');},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element
[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '+
this.namespace+'-state-disabled').attr("aria-disabled",value);}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);event=$.Event(event);event.type=eventName;if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};$.widget.defaults={disabled:false};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(event){return self._mouseDown(event);}).bind('click.'+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;event.stopImmediatePropagation();return false;}});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};if(event.originalEvent.mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);}
return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(event){return this.mouseDelayMet;},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.widget("ui.sortable",$.extend({},$.ui.mouse,{_init:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css('float')):false;this.offset=this.element.offset();this._mouseInit();},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--)
this.items[i].item.removeData("sortable-item");},_mouseCapture:function(event,overrideHandle){if(this.reverting){return false;}
if(this.options.disabled||this.options.type=='static')return false;this._refreshItems(event);var currentItem=null,self=this,nodes=$(event.target).parents().each(function(){if($.data(this,'sortable-item')==self){currentItem=$(this);return false;}});if($.data(event.target,'sortable-item')==self)currentItem=$(event.target);if(!currentItem)return false;if(this.options.handle&&!overrideHandle){var validHandle=false;$(this.options.handle,currentItem).find("*").andSelf().each(function(){if(this==event.target)validHandle=true;});if(!validHandle)return false;}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var o=this.options,self=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)
this._adjustOffsetFromHelper(o.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide();}
this._createPlaceholder();if(o.containment)
this._setContainment();if(o.cursor){if($('body').css("cursor"))this._storedCursor=$('body').css("cursor");$('body').css("cursor",o.cursor);}
if(o.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",o.opacity);}
if(o.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",o.zIndex);}
if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!='HTML')
this.overflowOffset=this.scrollParent.offset();this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions)
this._cacheHelperProportions();if(!noActivation){for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,self._uiHash(this));}}
if($.ui.ddmanager)
$.ui.ddmanager.current=this;if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(event);return true;},_mouseDrag:function(event){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;}
if(this.options.scroll){var o=this.options,scrolled=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!='HTML'){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity)
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity)
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}else{if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);}
this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+'px';if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+'px';for(var i=this.items.length-1;i>=0;i--){var item=this.items[i],itemElement=item.item[0],intersection=this._intersectsWithPointer(item);if(!intersection)continue;if(itemElement!=this.currentItem[0]&&this.placeholder[intersection==1?"next":"prev"]()[0]!=itemElement&&!$.ui.contains(this.placeholder[0],itemElement)&&(this.options.type=='semi-dynamic'?!$.ui.contains(this.element[0],itemElement):true)){this.direction=intersection==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;}
this._trigger("change",event,this._uiHash());break;}}
this._contactContainers(event);if($.ui.ddmanager)$.ui.ddmanager.drag(this,event);this._trigger('sort',event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event)return;if($.ui.ddmanager&&!this.options.dropBehaviour)
$.ui.ddmanager.drop(this,event);if(this.options.revert){var self=this;var cur=self.placeholder.offset();self.reverting=true;$(this.helper).animate({left:cur.left-this.offset.parent.left-self.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:cur.top-this.offset.parent.top-self.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){self._clear(event);});}else{this._clear(event,noPropagation);}
return false;},cancel:function(){var self=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original")
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");else
this.currentItem.show();for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,self._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,self._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(this.placeholder[0].parentNode)this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode)this.helper.remove();$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}
return true;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||'id')||'').match(o.expression||(/(.+)[-=_](.+)/));if(res)str.push((o.key||res[1]+'[]')+'='+(o.key&&o.expression?res[1]:res[2]));});return str.join('&');},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||'id')||'');});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var l=item.left,r=l+item.width,t=item.top,b=t+item.height;var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var isOverElement=(y1+dyClick)>t&&(y1+dyClick)<b&&(x1+dxClick)>l&&(x1+dxClick)<r;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?'width':'height']>item[this.floating?'width':'height'])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var isOverElementHeight=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(!isOverElement)
return false;return this.floating?(((horizontalDirection&&horizontalDirection=="right")||verticalDirection=="down")?2:1):(verticalDirection&&(verticalDirection=="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection=="right"&&isOverRightHalf)||(horizontalDirection=="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection=="down"&&isOverBottomHalf)||(verticalDirection=="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!=0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!=0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this.refreshPositions();},_connectWith:function(){var options=this.options;return options.connectWith.constructor==String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var self=this;var items=[];var queries=[];var connectWith=this._connectWith();if(connectWith&&connected){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper"),inst]);}};};}
queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var i=queries.length-1;i>=0;i--){queries[i][0].each(function(){items.push(this);});};return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data(sortable-item)");for(var i=0;i<this.items.length;i++){for(var j=0;j<list.length;j++){if(list[j]==this.items[i].item[0])
this.items.splice(i,1);};};},_refreshItems:function(event){this.items=[];this.containers=[this];var items=this.items;var self=this;var queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]];var connectWith=this._connectWith();if(connectWith){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}};};}
for(var i=queries.length-1;i>=0;i--){var targetData=queries[i][1];var _queries=queries[i][0];for(var j=0,queriesLength=_queries.length;j<queriesLength;j++){var item=$(_queries[j]);item.data('sortable-item',targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});};};},refreshPositions:function(fast){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();}
for(var i=this.items.length-1;i>=0;i--){var item=this.items[i];if(item.instance!=this.currentContainer&&this.currentContainer&&item.item[0]!=this.currentItem[0])
continue;var t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();}
var p=t.offset();item.left=p.left;item.top=p.top;};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(var i=this.containers.length-1;i>=0;i--){var p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();};}},_createPlaceholder:function(that){var self=that||this,o=self.options;if(!o.placeholder||o.placeholder.constructor==String){var className=o.placeholder;o.placeholder={element:function(){var el=$(document.createElement(self.currentItem[0].nodeName)).addClass(className||self.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!className)
el.style.visibility="hidden";return el;},update:function(container,p){if(className&&!o.forcePlaceholderSize)return;if(!p.height()){p.height(self.currentItem.innerHeight()-parseInt(self.currentItem.css('paddingTop')||0,10)-parseInt(self.currentItem.css('paddingBottom')||0,10));};if(!p.width()){p.width(self.currentItem.innerWidth()-parseInt(self.currentItem.css('paddingLeft')||0,10)-parseInt(self.currentItem.css('paddingRight')||0,10));};}};}
self.placeholder=$(o.placeholder.element.call(self.element,self.currentItem));self.currentItem.after(self.placeholder);o.placeholder.update(self,self.placeholder);},_contactContainers:function(event){for(var i=this.containers.length-1;i>=0;i--){if(this._intersectsWith(this.containers[i].containerCache)){if(!this.containers[i].containerCache.over){if(this.currentContainer!=this.containers[i]){var dist=10000;var itemWithLeastDistance=null;var base=this.positionAbs[this.containers[i].floating?'left':'top'];for(var j=this.items.length-1;j>=0;j--){if(!$.ui.contains(this.containers[i].element[0],this.items[j].item[0]))continue;var cur=this.items[j][this.containers[i].floating?'left':'top'];if(Math.abs(cur-base)<dist){dist=Math.abs(cur-base);itemWithLeastDistance=this.items[j];}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty)
continue;this.currentContainer=this.containers[i];itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[i].element,true);this._trigger("change",event,this._uiHash());this.containers[i]._trigger("change",event,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);}
this.containers[i]._trigger("over",event,this._uiHash(this));this.containers[i].containerCache.over=1;}}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}};},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper=='clone'?this.currentItem.clone():this.currentItem);if(!helper.parents('body').length)
$(o.appendTo!='parent'?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);if(helper[0]==this.currentItem[0])
this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(helper[0].style.width==''||o.forceHelperSize)helper.width(this.currentItem.width());if(helper[0].style.height==''||o.forceHelperSize)helper.height(this.currentItem.height());return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))
po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)){var ce=$(o.containment)[0];var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}
if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=='down'?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var self=this,counter=this.counter;window.setTimeout(function(){if(counter==self.counter)self.refreshPositions(!hardRefresh);},0);},_clear:function(event,noPropagation){this.reverting=false;var delayedTriggers=[],self=this;if(!this._noFinalSort&&this.currentItem[0].parentNode)this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS){if(this._storedCSS[i]=='auto'||this._storedCSS[i]=='static')this._storedCSS[i]='';}
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}
if(this.fromOutside&&!noPropagation)delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside));});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!noPropagation)delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});if(!$.ui.contains(this.element[0],this.currentItem[0])){if(!noPropagation)delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});for(var i=this.containers.length-1;i>=0;i--){if($.ui.contains(this.containers[i].element[0],this.currentItem[0])&&!noPropagation){delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.containers[i]));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.containers[i]));}};};for(var i=this.containers.length-1;i>=0;i--){if(!noPropagation)delayedTriggers.push((function(c){return function(event){c._trigger("deactivate",event,this._uiHash(this));};}).call(this,this.containers[i]));if(this.containers[i].containerCache.over){delayedTriggers.push((function(c){return function(event){c._trigger("out",event,this._uiHash(this));};}).call(this,this.containers[i]));this.containers[i].containerCache.over=0;}}
if(this._storedCursor)$('body').css("cursor",this._storedCursor);if(this._storedOpacity)this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=='auto'?'':this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);};this._trigger("stop",event,this._uiHash());}
return false;}
if(!noPropagation)this._trigger("beforeStop",event,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0])this.helper.remove();this.helper=null;if(!noPropagation){for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);};this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return true;},_trigger:function(){if($.widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(inst){var self=inst||this;return{helper:self.helper,placeholder:self.placeholder||$([]),position:self.position,absolutePosition:self.positionAbs,offset:self.positionAbs,item:self.currentItem,sender:inst?inst.element:null};}}));$.extend($.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:'auto',cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:'> *',opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}});})(jQuery);(function($){$.fileUpload=function(options){return $.fileUpload.impl.init(options);};$.fileUpload.checkProgress=function(){return $.fileUpload.impl.checkProgress();};$.fileUpload.start=function(form){return $.fileUpload.impl.start(form);};$.fileUpload.cancel=function(){return $.fileUpload.impl.cancel();};$.fileUpload.stop=function(){return $.fileUpload.impl.stop();};$.fileUpload.complete=function(script,href,errors){return $.fileUpload.impl.complete(script,href,errors);};$.fileUpload.defaults={showLoader:true,showPercentBar:true,showPercent:true,showAvgSpeed:false,showTimeLeft:true,showCancel:true,interval:600,progressUrl:'/index/uploadProgress/',idUploadKey:'APC_UPLOAD_PROGRESS',idLoader:'ajaxLoader',idProgressDiv:'FUuploadProgress',idPercentBar:'FUpercentBar',idPercent:'FUpercent',idAvgSpeed:'FUavgSpeed',idTimeLeft:'FUtimeLeft',idCancel:'FUcancel',autoUpload:true,classBound:'FUbound',classNoAuto:'FUnoAutoUpload',onChange:null,onStart:function(){$('.errorMsgs').remove();},onCancel:null,onStop:null,onComplete:function(script,href,errors){if(script){eval(script);}else if(href){if(errors){for(var e in errors){href+=(href.indexOf('?')>0?'&':'?')+'errors[]='+errors[e];}}
window.location=href;}else if(errors){href=window.location.href;href=href.replace(/\?.*/,'');for(var e in errors){href+=(href.indexOf('?')>0?'&':'?')+'errors[]='+errors[e];}
window.location=href;}}};$.fileUpload.impl={opts:{},timer:null,input:null,iFrame:null,div:null,percentBar:null,percent:null,avgSpeed:null,timeLeft:null,cancelBtn:null,init:function(options){var f=this;if(!f.div){f.opts=$.extend({},$.fileUpload.defaults,options);f.div=$('<div></div>').attr('id',f.opts.idProgressDiv).css('display','none').appendTo($('#'+f.opts.idLoader));if(f.opts.showPercentBar)
f.percentBar=$('<div></div>').attr('id',f.opts.idPercentBar).appendTo(f.div);if(f.opts.showPercent)
f.percent=$('<span></span>').attr('id',f.opts.idPercent).appendTo(f.div);if(f.opts.showAvgSpeed)
f.avgSpeed=$('<span></span>').attr('id',f.opts.idAvgSpee).appendTo(f.div);if(f.opts.showTimeLeft)
f.timeLeft=$('<span></span>').attr('id',f.opts.idTimeLeft).appendTo(f.div);if(f.opts.showCancel){f.cancelBtn=$('<a></a>').attr('id',f.opts.idCancel).attr('href','#').html('<span>Cancel</span>').appendTo(f.div);f.cancelBtn.click(function(e){e.preventDefault();f.cancel();});}}
f.bind();},change:function(file){this.input=$(file);if($.isFunction(this.opts.onChange)){this.opts.onChange.apply(this,[file]);}
if(this.opts.autoUpload)
$(file.form).not('.'+this.opts.classNoAuto).trigger('submit');},clear:function(){this.input.removeAttr('value');},start:function(form){if($.isFunction(this.opts.onStart)){this.opts.onStart.apply(this,[form]);}
this.show();this.resetProgress();this.checkProgress();this.iFrame=$('#'+form.target);},cancel:function(){this.stop();if($.isFunction(this.opts.onCancel)){this.opts.onCancel.apply(this);}},stop:function(){clearTimeout(this.timer);this.hide();this.clear();this.iFrame.attr('src','about:blank');if($.isFunction(this.opts.onStop)){this.opts.onStop.apply(this);}},complete:function(){var a=arguments;this.stop();if($.isFunction(this.opts.onComplete)){this.opts.onComplete.apply(this,a);}},checkProgress:function(){var f=this;$.getJSON(f.opts.progressUrl,{id:$('#'+f.opts.idUploadKey).val()},function(data){f.updateProgress(data);});f.timer=setTimeout('$.fileUpload.checkProgress()',f.opts.interval);},updateProgress:function(data){var f=this;if(f.percentBar)
f.percentBar.css('width',data.percent+'%');if(f.percent)
f.percent.text(data.percent+'%');if(f.timeLeft)
f.timeLeft.text(data.timeLeft);if(f.avgSpeed)
f.avgSpeed.text(data.avgSpeed);},resetProgress:function(){this.updateProgress({percent:0,timeLeft:'Calculating...',avgSpeed:''});},show:function(){$.ajaxLoader.unBind();$.ajaxLoader.show();this.div.show();},hide:function(){this.div.hide();$.ajaxLoader.hide();$.ajaxLoader.bind();},bind:function(){var f=this;var $file=$(':file');$file.parents('form').not('.'+f.opts.classBound).submit(function(e){f.start(this);}).addClass(f.opts.classBound);$file.not('.'+f.opts.classBound).change(function(e){f.change(this);}).addClass(f.opts.classBound);}};})(jQuery);(function($){$.audioRecorder=function(opts){return $.audioRecorder.impl.init(opts);};$.audioRecorder.record=function(){return $.audioRecorder.impl.record();};$.audioRecorder.stop=function(){return $.audioRecorder.impl.stop();};$.audioRecorder.play=function(){return $.audioRecorder.impl.play();};$.audioRecorder.pause=function(){return $.audioRecorder.impl.pause();};$.audioRecorder.resume=function(){return $.audioRecorder.impl.resume();};$.audioRecorder.settings=function(){return $.audioRecorder.impl.settings();};$.audioRecorder.updateStatus=function(code){return $.audioRecorder.impl.updateStatus(code);};$.audioRecorder.defaults={idControl:'audioRecorderControl',idFlash:'audioRecorder',classRecord:'arRecord',classStop:'arStop',classPause:'arPause',classPlay:'arPlay',classSettings:'arSettings',classDisabled:'arDisabled',classBound:'arBound',fileExists:false,onLoad:null,onConnect:null,onConnectFail:null,onMicDeny:null,onMicAllow:null,onMicActivity:null,beforeRecord:null,onRecord:null,onRecordStop:null,beforePlay:null,onPlay:null,onPlayTime:null,onPlayStop:null,onPlayEnd:null,onPlayPause:null,onPlayResume:null};$.audioRecorder.impl={opts:{},console:{},status:{recording:false,playing:false},buttons:{record:{},stop:{},pause:{},play:{},settings:{}},init:function(opts){this.opts=$.extend({},$.audioRecorder.defaults,opts);this.bind();},initConsole:function(){if($.browser.msie)
this.console=window[this.opts.idFlash];else
this.console=document[this.opts.idFlash];},bind:function(){var a=this;a.initConsole();var $c=$('#'+a.opts.idControl);a.buttons.record=$('.'+a.opts.classRecord,$c).not('.'+a.opts.classBound).click(function(e){e.preventDefault();if(!a.isDisabled(this))
a.record();}).addClass(a.opts.classBound);a.disableButton(a.buttons.record);a.buttons.stop=$('.'+a.opts.classStop,$c).not('.'+a.opts.classBound).click(function(e){e.preventDefault();a.stop();}).addClass(a.opts.classBound);a.disableButton(a.buttons.stop);a.buttons.play=$('.'+a.opts.classPlay,$c).not('.'+a.opts.classBound).click(function(e){e.preventDefault();if(!a.isDisabled(this))
a.play();}).addClass(a.opts.classBound);a.disableButton(a.buttons.play);a.buttons.pause=$('.'+a.opts.classPause,$c).not('.'+a.opts.classBound).click(function(e){e.preventDefault();if(!a.isDisabled(this))
a.pause();}).addClass(a.opts.classBound);a.disableButton(a.buttons.pause);a.buttons.settings=$('.'+a.opts.classSettings,$c).not('.'+a.opts.classBound).click(function(e){e.preventDefault();if(!a.isDisabled(this))
a.settings();}).addClass(a.opts.classBound);},enableButton:function(b){if(this.isDisabled(b))
$(b).removeClass(this.opts.classDisabled)},disableButton:function(b){if(!this.isDisabled(b))
$(b).addClass(this.opts.classDisabled);},isDisabled:function(b){return $(b).hasClass(this.opts.classDisabled)||$(b).hasClass('disabled')?true:false;},setFile:function(f){this.console.setAudio(f);},record:function(){if(this.console.micMuted()){this.settings();}else{if($.isFunction(this.opts.beforeRecord)){this.opts.beforeRecord.apply(this,[]);}
this.console.recAudio();}},stop:function(){this.console.stopAudio();},pause:function(){this.console.pauseAudio();},resume:function(){this.console.resumeAudio();},play:function(){if(this.status.playing){this.console.resumeAudio();}else{if($.isFunction(this.opts.beforePlay)){this.opts.beforePlay.apply(this,[]);}
this.console.playAudio();}},settings:function(){this.console.showSettings();},updateStatus:function(data){var a=this;if(!$.isArray(data))
data=[data];switch(data[0]){case'AudioRecorder.Init.Start':if($.isFunction(a.opts.onLoad)){a.opts.onLoad.apply(a,data);}
break;case'AudioRecorder.Init.Stop':break;case'Microphone.Muted':a.stop();a.disableButton(a.buttons.record);a.disableButton(a.buttons.stop);a.disableButton(a.buttons.play);if($.isFunction(a.opts.onMicDeny)){a.opts.onMicDeny.apply(a,data);}
break;case'Microphone.Unmuted':a.enableButton(a.buttons.record);if(a.opts.fileExists)
a.enableButton(a.buttons.play);if($.isFunction(a.opts.onMicAllow)){a.opts.onMicAllow.apply(a,data);}
break;case'Microphone.Active':if($.isFunction(a.opts.onMicActivity)){a.opts.onMicActivity.apply(a,data);}
break;case'NetConnection.Connect.Success':a.enableButton(a.buttons.record);if(a.opts.fileExists)
a.enableButton(a.buttons.play);if($.isFunction(a.opts.onConnect)){a.opts.onConnect.apply(a,data);}
break;case'NetConnection.Connect.Rejected':break;case'NetConnection.Connect.Failed':break;case'NetConnection.Connect.Closed':a.disableButton(a.buttons.record);a.disableButton(a.buttons.stop);a.disableButton(a.buttons.play);if($.isFunction(a.opts.onConnectFail)){a.opts.onConnectFail.apply(a,data);}
break;case'NetStream.Publish.Start':break;case'NetStream.Record.Start':a.status.recording=true;a.disableButton(a.buttons.record);a.disableButton(a.buttons.play);a.enableButton(a.buttons.stop);if($.isFunction(a.opts.onRecord)){a.opts.onRecord.apply(a,data);}
break;case'NetStream.Record.Stop':break;case'NetStream.Unpublish.Success':a.opts.fileExists=true;a.status.recording=false;a.disableButton(a.buttons.stop);a.enableButton(a.buttons.play);a.enableButton(a.buttons.record);if($.isFunction(a.opts.onRecordStop)){a.opts.onRecordStop.apply(a,data);}
break;case'AudioRecorder.Record.Stop':break;case'NetStream.Play.Reset':break;case'NetStream.Play.Start':a.status.playing=true;a.disableButton(a.buttons.record);a.disableButton(a.buttons.play);a.enableButton(a.buttons.stop);a.enableButton(a.buttons.pause);if($.isFunction(a.opts.onPlay)){a.opts.onPlay.apply(a,data);}
break;case'AudioRecorder.Play.Time':if(data[2]==0)
a.stop();if($.isFunction(a.opts.onPlayTime)){a.opts.onPlayTime.apply(a,data);}
break;case'NetStream.Play.Stop':break;case'NetStream.Buffer.Full':break;case'NetStream.Buffer.Flush':break;case'NetStream.Buffer.Empty':break;case'AudioRecorder.Play.End':if($.isFunction(a.opts.onPlayEnd)){a.opts.onPlayEnd.apply(a,data);}
break;case'AudioRecorder.Play.Pause':a.enableButton(a.buttons.play);a.enableButton(a.buttons.stop);a.disableButton(a.buttons.pause);if($.isFunction(a.opts.onPlayPause)){a.opts.onPlayPause.apply(a,data);}
break;case'AudioRecorder.Play.Resume':if($.isFunction(a.opts.onPlayResume)){a.opts.onPlayResume.apply(a,data);}
break;case'AudioRecorder.Play.Stop':a.status.playing=false;a.disableButton(a.buttons.stop);a.disableButton(a.buttons.pause);a.enableButton(a.buttons.play);a.enableButton(a.buttons.record);if($.isFunction(a.opts.onPlayStop)){a.opts.onPlayStop.apply(a,data);}
break;}}};})(jQuery);jQuery.fn.rte=function(options,editors){if(!editors||editors.constructor!=Array)
editors=new Array();$(this).each(function(i){var id=(this.id)?this.id:editors.length-1;editors[id]=new lwRTE(this,options||{});});return editors;}
var lwRTE=function(textarea,options){this.css=[];this.css_class=options.frame_class||'';this.base_url=options.base_url||'';this.width=options.width||$(textarea).width()||'100%';this.height=options.height||$(textarea).height()||350;this.change=options.change||null;this.iframe=null;this.iframe_doc=null;this.textarea=null;this.event=null;this.range=null;this.toolbars={rte:'',html:''};this.controls={rte:{disable:{hint:'Source editor'}},html:{enable:{hint:'Visual editor'}}};$.extend(this.controls.rte,options.controls_rte||{});$.extend(this.controls.html,options.controls_html||{});$.extend(this.css,options.css||{});if(document.designMode||document.contentEditable){$(textarea).wrap($('<div></div>').addClass('rte-zone').width(this.width));this.textarea=textarea;this.enable_design_mode();}}
lwRTE.prototype.editor_cmd=function(command,args){this.iframe.contentWindow.focus();try{this.iframe_doc.execCommand(command,false,args);}catch(e){}
this.iframe.contentWindow.focus();}
lwRTE.prototype.get_toolbar=function(){var editor=(this.iframe)?$(this.iframe):$(this.textarea);return(editor.prev().hasClass('rte-toolbar'))?editor.prev():null;}
lwRTE.prototype.activate_toolbar=function(editor,tb){var old_tb=this.get_toolbar();if(old_tb)
old_tb.remove();$(editor).before($(tb).clone(true));}
lwRTE.prototype.enable_design_mode=function(){var self=this;self.iframe=document.createElement("iframe");self.iframe.frameBorder=0;self.iframe.frameMargin=0;self.iframe.framePadding=0;self.iframe.width='100%';self.iframe.height=self.height||'100%';self.iframe.src="javascript:void(0);";if($(self.textarea).attr('class'))
self.iframe.className=$(self.textarea).attr('class');if($(self.textarea).attr('id'))
self.iframe.id=$(self.textarea).attr('id');if($(self.textarea).attr('name'))
self.iframe.title=$(self.textarea).attr('name');var content=$(self.textarea).val();$(self.textarea).hide().after(self.iframe).remove();self.textarea=null;var css='';for(var i in self.css)
css+="<link type='text/css' rel='stylesheet' href='"+self.css[i]+"' />";var base=(self.base_url)?"<base href='"+self.base_url+"' />":'';var style=(self.css_class)?"class='"+self.css_class+"'":'';var doc="<html><head>"+base+css+"</head><body "+style+" style='padding:5px'>"+content+"</body></html>";self.iframe_doc=self.iframe.contentWindow.document;try{self.iframe_doc.designMode='on';}catch(e){$(self.iframe_doc).focus(function(){self.iframe_doc.designMode();});}
self.iframe_doc.open();self.iframe_doc.write(doc);self.iframe_doc.close();if(!self.toolbars.rte)
self.toolbars.rte=self.create_toolbar(self.controls.rte);self.activate_toolbar(self.iframe,self.toolbars.rte);$(self.iframe).parents('form').submit(function(){self.disable_design_mode(true);});$(self.iframe_doc).mouseup(function(event){if(self.iframe_doc.selection)
self.range=self.iframe_doc.selection.createRange();self.set_selected_controls((event.target)?event.target:event.srcElement,self.controls.rte);});$(self.iframe_doc).blur(function(event){if(self.iframe_doc.selection)
self.range=self.iframe_doc.selection.createRange();});$(self.iframe_doc).keyup(function(event){if($.isFunction(self.change))
self.change.apply(this,[]);self.set_selected_controls(self.get_selected_element(),self.controls.rte);});if(!$.browser.msie)
self.editor_cmd('styleWithCSS',false);}
lwRTE.prototype.disable_design_mode=function(submit){var self=this;self.textarea=(submit)?$('<input type="hidden" />').get(0):$('<textarea></textarea>').width('100%').height(self.height).get(0);if(self.iframe.className)
self.textarea.className=self.iframe.className;if(self.iframe.id)
self.textarea.id=self.iframe.id;if(self.iframe.title)
self.textarea.name=self.iframe.title;$(self.textarea).val($('body',self.iframe_doc).html());$(self.iframe).before(self.textarea);if(!self.toolbars.html)
self.toolbars.html=self.create_toolbar(self.controls.html);if(submit!=true){$(self.iframe_doc).remove();$(self.iframe).remove();self.iframe=self.iframe_doc=null;self.activate_toolbar(self.textarea,self.toolbars.html);}}
lwRTE.prototype.toolbar_click=function(obj,control){var fn=control.exec;var args=control.args||[];var is_select=(obj.tagName.toUpperCase()=='SELECT');$('.rte-panel',this.get_toolbar()).remove();if(fn){if(is_select)
args.push(obj);try{fn.apply(this,args);}catch(e){}}else if(this.iframe&&control.command){if(is_select){args=obj.options[obj.selectedIndex].value;if(args.length<=0)
return;}
this.editor_cmd(control.command,args);}}
lwRTE.prototype.create_toolbar=function(controls){var self=this;var tb=$("<div></div>").addClass('rte-toolbar').width('100%').append($("<ul></ul>")).append($("<div></div>").addClass('clear'));var obj,li;for(var key in controls){if(controls[key].separator){li=$("<li></li>").addClass('separator');}else{if(controls[key].init){try{controls[key].init.apply(controls[key],[this]);}catch(e){}}
if(controls[key].select){obj=$(controls[key].select).change(function(e){self.event=e;self.toolbar_click(this,controls[this.className]);return false;});}else{obj=$("<a href='#'></a>").attr('title',(controls[key].hint)?controls[key].hint:key).attr('rel',key).click(function(e){self.event=e;self.toolbar_click(this,controls[this.rel]);return false;})}
li=$("<li></li>").append(obj.addClass(key));}
$("ul",tb).append(li);}
$('.enable',tb).click(function(){self.enable_design_mode();return false;});$('.disable',tb).click(function(){self.disable_design_mode();return false;});return tb.get(0);}
lwRTE.prototype.create_panel=function(title,width){var self=this;var tb=self.get_toolbar();if(!tb)
return false;$('.rte-panel',tb).remove();var drag,event;var left=self.event.pageX;var top=self.event.pageY;var panel=$('<div></div>').hide().addClass('rte-panel').css({left:left,top:top});$('<div></div>').addClass('rte-panel-title').html(title).append($("<a class='close' href='#'>X</a>").click(function(){panel.remove();return false;})).mousedown(function(){drag=true;return false;}).mouseup(function(){drag=false;return false;}).mousemove(function(e){if(drag&&event){left-=event.pageX-e.pageX;top-=event.pageY-e.pageY;panel.css({left:left,top:top});}
event=e;return false;}).appendTo(panel);if(width)
panel.width(width);tb.append(panel);return panel;}
lwRTE.prototype.get_content=function(){return(this.iframe)?$('body',this.iframe_doc).html():$(this.textarea).val();}
lwRTE.prototype.set_content=function(content){(this.iframe)?$('body',this.iframe_doc).html(content):$(this.textarea).val(content);}
lwRTE.prototype.set_selected_controls=function(node,controls){var toolbar=this.get_toolbar();if(!toolbar)
return false;var key,i_node,obj,control,tag,i,value;try{for(key in controls){control=controls[key];obj=$('.'+key,toolbar);obj.removeClass('active');if(!control.tags)
continue;i_node=node;do{if(i_node.nodeType!=1)
continue;tag=i_node.nodeName.toLowerCase();if($.inArray(tag,control.tags)<0)
continue;if(control.select){obj=obj.get(0);if(obj.tagName.toUpperCase()=='SELECT'){for(i=0;i<obj.options.length;i++){value=obj.options[i].value;if(value&&((control.tag_cmp&&control.tag_cmp(i_node,value))||tag==value)){obj.selectedIndex=i;break;}}}}else
obj.addClass('active');}while(i_node=i_node.parentNode)}}catch(e){}
return true;}
lwRTE.prototype.get_selected_element=function(){var node,selection,range;var iframe_win=this.iframe.contentWindow;if(iframe_win.getSelection){try{selection=iframe_win.getSelection();range=selection.getRangeAt(0);node=range.commonAncestorContainer;}catch(e){return false;}}else{try{selection=iframe_win.document.selection;range=selection.createRange();node=range.parentElement();}catch(e){return false;}}
return node;}
lwRTE.prototype.get_selection_range=function(){var rng=null;var iframe_window=this.iframe.contentWindow;this.iframe.focus();if(iframe_window.getSelection){rng=iframe_window.getSelection().getRangeAt(0);if($.browser.opera){var s=rng.startContainer;if(s.nodeType===Node.TEXT_NODE)
rng.setStartBefore(s.parentNode);}}else{this.range.select();rng=this.iframe_doc.selection.createRange();}
return rng;}
lwRTE.prototype.get_selected_text=function(){var iframe_win=this.iframe.contentWindow;if(iframe_win.getSelection)
return iframe_win.getSelection().toString();this.range.select();return iframe_win.document.selection.createRange().text;};lwRTE.prototype.get_selected_html=function(){var html=null;var iframe_window=this.iframe.contentWindow;var rng=this.get_selection_range();if(rng){if(iframe_window.getSelection){var e=document.createElement('div');e.appendChild(rng.cloneContents());html=e.innerHTML;}else{html=rng.htmlText;}}
return html;};lwRTE.prototype.selection_replace_with=function(html){var rng=this.get_selection_range();var iframe_window=this.iframe.contentWindow;if(!rng)
return;this.editor_cmd('removeFormat');if(iframe_window.getSelection){rng.deleteContents();rng.insertNode(rng.createContextualFragment(html));this.editor_cmd('delete');}else{this.editor_cmd('delete');rng.pasteHTML(html);}};(function($){$.fn.bg9=function(){var suffixes=['TL','TC','TR','CL','CC','CR','BL','BC','BR'];this.each(function(){var $c=$(this);if($c.css('position')!='absolute'&&$c.css('position')!='relative')
$c.css('position','relative');for(i in suffixes){$('<span>&nbsp;</span>').addClass('bg9'+suffixes[i]).css({position:'absolute',zIndex:-1,display:'block'}).prependTo($c);}});};})(jQuery);(function($){$.fn.overlabel=function(options){var opts=$.extend({},$.fn.overlabel.defaults,options);var selection=this.filter('label[for]').map(function(){var label=$(this);var id=label.attr('for');var field=document.getElementById(id);if(!field)return;var o=$.meta?$.extend({},opts,label.data()):opts;label.addClass(o.label_class);var hide_label=function(){label.css(o.hide_css)};var show_label=function(){this.value||label.css(o.show_css)};$(field).parent().addClass(o.wrapper_class).end().focus(hide_label).blur(show_label).each(hide_label).each(show_label);return this;});return opts.filter?selection:selection.end();};$.fn.overlabel.defaults={label_class:'overlabel-apply',wrapper_class:'overlabel-wrapper',hide_css:{'display':'block','width':'0','height':'0','overflow':'hidden'},show_css:{'display':'inline','width':'auto','height':'auto','overflow':'auto'},filter:false};})(jQuery);$.ajaxSetup({cache:false,beforeSend:function(r){r.setRequestHeader('X-Requested-By','jqueryAjax');}});(function($){$.promptModal=function(msg,opts){return $.promptModal.impl.open(msg,opts);};$.promptModal.defaults={overlayId:'promptModalOverlay',overlayClass:'promptModalOverlay',windowId:'promptModalWindow',windowClass:'promptModalWindow',headerId:'promptModalHeader',containerId:'promptModalContainer',dataClass:'promptModalData',appendTo:'#pageAll',overlay:80,header:false,close:false,closeClass:'promptClose',buttonClass:'promptButton',buttons:{Yes:true,No:false},onOpen:modalEffect.fadeIn,onClose:modalEffect.fadeOut,onSubmit:null};$.promptModal.impl={modal:{},open:function(msg,opts){var p=this;var o=$.extend({},$.promptModal.defaults,opts);o=$.extend({},o,{onShow:function(d){$('a.'+o.buttonClass).unbind('click').click(function(e){e.preventDefault();if(this.target&&this.target!='false'&&$.isFunction(o.onSubmit)){o.onSubmit.apply(p,[p.modal,this.target]);}
p.modal.close();});}});var html='<h4>'+msg+'</h4>';html+='<ul class="clearfix">';$.each(o.buttons,function(k,v){html+='<li><a href="#" id="button'+k+'" target="'+v+'" class="'+o.buttonClass+' '+o.closeClass+'"><span>'+k+'</span></a></li>';});html+='</ul>';this.modal=$('<div>').html(html).modal(o);return this.modal;}};})(jQuery);var rte_tag='-rte-tmp-tag-';var rte_toolbar={s1:{separator:true},bold:{command:'bold',tags:['b','strong']},italic:{command:'italic',tags:['i','em']},underline:{command:'underline',tags:['u']},s2:{separator:true},size:{command:'fontsize',select:'\
  <select>\
   <option value="">--Size--</option>\
   <option class="textSizeSml" value="2">Small</option>\
   <option class="textSizeMed" value="3">Medium</option>\
   <option class="textSizeLrg" value="5">Large</options>\
   <option class="textSizeXlg" value="6">X-Large</options>\
  </select>\
   ',tags:['font','span']},s3:{separator:true},removeFormat:{exec:lwrte_unformat},word:{exec:lwrte_cleanup_word},clear:{exec:lwrte_clear}};var html_toolbar={s1:{separator:true},word:{exec:lwrte_cleanup_word},clear:{exec:lwrte_clear}};function lwrte_unformat(){this.editor_cmd('removeFormat');this.editor_cmd('unlink');}
function lwrte_clear(){if(confirm('Clear Document?'))
this.set_content('');}
function lwrte_cleanup_word(){this.set_content(cleanup_word(this.get_content(),true,true,true));function cleanup_word(s,bIgnoreFont,bRemoveStyles,bCleanWordKeepsStructure){s=s.replace(/<o:p>\s*<\/o:p>/g,'');s=s.replace(/<o:p>[\s\S]*?<\/o:p>/g,'&nbsp;');s=s.replace(/\s*mso-[^:]+:[^;"]+;?/gi,'');s=s.replace(/\s*MARGIN: 0cm 0cm 0pt\s*;/gi,'');s=s.replace(/\s*MARGIN: 0cm 0cm 0pt\s*"/gi,"\"");s=s.replace(/\s*TEXT-INDENT: 0cm\s*;/gi,'');s=s.replace(/\s*TEXT-INDENT: 0cm\s*"/gi,"\"");s=s.replace(/\s*TEXT-ALIGN: [^\s;]+;?"/gi,"\"");s=s.replace(/\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi,"\"");s=s.replace(/\s*FONT-VARIANT: [^\s;]+;?"/gi,"\"");s=s.replace(/\s*tab-stops:[^;"]*;?/gi,'');s=s.replace(/\s*tab-stops:[^"]*/gi,'');if(bIgnoreFont){s=s.replace(/\s*face="[^"]*"/gi,'');s=s.replace(/\s*face=[^ >]*/gi,'');s=s.replace(/\s*FONT-FAMILY:[^;"]*;?/gi,'');}
s=s.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");if(bRemoveStyles)
s=s.replace(/<(\w[^>]*) style="([^\"]*)"([^>]*)/gi,"<$1$3");s=s.replace(/<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi,'');s=s.replace(/<(?:META|LINK)[^>]*>\s*/gi,'');s=s.replace(/\s*style="\s*"/gi,'');s=s.replace(/<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi,'&nbsp;');s=s.replace(/<SPAN\s*[^>]*><\/SPAN>/gi,'');s=s.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");s=s.replace(/<SPAN\s*>([\s\S]*?)<\/SPAN>/gi,'$1');s=s.replace(/<FONT\s*>([\s\S]*?)<\/FONT>/gi,'$1');s=s.replace(/<\\?\?xml[^>]*>/gi,'');s=s.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,'');s=s.replace(/<\/?\w+:[^>]*>/gi,'');s=s.replace(/<\!--[\s\S]*?-->/g,'');s=s.replace(/<(U|I|STRIKE)>&nbsp;<\/\1>/g,'&nbsp;');s=s.replace(/<H\d>\s*<\/H\d>/gi,'');s=s.replace(/<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig,'');s=s.replace(/<(\w[^>]*) language=([^ |>]*)([^>]*)/gi,"<$1$3");s=s.replace(/<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi,"<$1$3");s=s.replace(/<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi,"<$1$3");if(bCleanWordKeepsStructure){s=s.replace(/<H(\d)([^>]*)>/gi,'<h$1>');s=s.replace(/<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi,'<$1>$2<\/$1>');s=s.replace(/<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi,'<$1>$2<\/$1>');}else{s=s.replace(/<H1([^>]*)>/gi,'<div$1><b><font size="6">');s=s.replace(/<H2([^>]*)>/gi,'<div$1><b><font size="5">');s=s.replace(/<H3([^>]*)>/gi,'<div$1><b><font size="4">');s=s.replace(/<H4([^>]*)>/gi,'<div$1><b><font size="3">');s=s.replace(/<H5([^>]*)>/gi,'<div$1><b><font size="2">');s=s.replace(/<H6([^>]*)>/gi,'<div$1><b><font size="1">');s=s.replace(/<\/H\d>/gi,'<\/font><\/b><\/div>');var re=new RegExp('(<P)([^>]*>[\\s\\S]*?)(<\/P>)','gi');s=s.replace(re,'<div$2<\/div>');s=s.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');s=s.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');s=s.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');}
return s;}}
$(function(){lbtInit.init();});var JQB='jqueryBound';var lbt={dbdJS:dbdJS,finishCoverUpload:function(id,title,author,src,paths){$('input[name=story_id][value!='+id+']').val(id);$('#storyCover').attr('src',src);var href=$('a.artPadModal').attr('href');href=href.replace(/\?.*/,'');href+='?story_id='+id+'&image='+$.trim(paths[0]);$('a.artPadModal').attr('href',href);href=$('a.storyCover').attr('href');href=href.replace(/\?.*/,'');href+='?image='+$.trim(paths[0]);$('a.storyCover').attr('href',href);$('#image_file').val($.trim(paths[0]));$('#image_file_med').val($.trim(paths[1]));$('#image_file_sml').val($.trim(paths[2]));if($('#title').val()=='')
$('#title').val(title);if($('#author').val()=='')
$('#author').val(author);$('.errorMsgs').remove();},finishPageUpload:function(id,src,paths){$('input[name=story_page_id][value!='+id+']').val(id);$('#storyPageImage').attr('src',src);var href=$('a.artPadModal').attr('href');href=href.replace(/\?.*/,'');href+='?story_page_id='+id+'&image='+$.trim(paths[0]);$('a.artPadModal').attr('href',href);href=$('a.storyPageImage').attr('href');href=href.replace(/\?.*/,'');href+='?image='+$.trim(paths[0]);$('a.storyPageImage').attr('href',href);$('#image_file').val($.trim(paths[0]));$('#image_file_med').val($.trim(paths[1]));$('#image_file_sml').val($.trim(paths[2]));buttons.savePage();$('.errorMsgs').remove();},finishContactUpload:function(id,src){$('input[name=contact_id][value!='+id+']').val(id);$('#contactAvatar').attr('src',src);$('.errorMsgs').remove();},finishStudentImport:function(success_import,skipped_import,failed_import){var myObject=eval('('+success_import+')');var html_data='<span class="import_header">Imported</span>';if(myObject.length==0)
{html_data+="<div>No items were imported.</div>";}
else
{for(i=0;i<myObject.length;i++)
{html_data+="<div class='success_import_item'>"+myObject[i]+"</div>";}}
$('#import_results #success_import').html(html_data);var myObject=eval('('+skipped_import+')');if(myObject.length>0)
{var html_data='<span class="import_header">Duplicates</span>';for(i=0;i<myObject.length;i++)
{html_data+="<div class='skipped_import_item'>"+myObject[i]+"</div>";}
$('#import_results #skipped_import').html(html_data);}
else
{$('#import_results #skipped_import').html("");}
var myObject=eval('('+failed_import+')');if(myObject.length>0)
{var html_data='<span class="import_header">Errors</span>';for(i=0;i<myObject.length;i++)
{html_data+="<div class='failed_import_item'>"+myObject[i]+"</div>";}
$('#import_results #failed_import').html(html_data);}
else
{$('#import_results #failed_import').html("");}
$('.errorMsgs').remove();$('div#import_results').show();},addContactEmails:function(addresses){var $to=$('input[name=email_to]');var v=$to.val();if(v!=''&&addresses!='')
v+=',';v+=addresses;$to.val(v);$.modal.close();},closeModal:function(){$.modal.close();},refreshClassDetails:function(data){var row_id='tr._'+data.id;$(row_id).find('td.name').html(data.name);$(row_id).find('td.username').html(data.username);$(row_id).find('td.password').html(data.password);$.modal.close();$(row_id).effect("highlight",{color:'#ED601B'},4000);},addStudentToClassDetails:function(data){$('.studentList').html(data.html)
var row_id='tr._'+data.id;$.modal.close();$(row_id).effect("highlight",{color:'#ED601B'},4000);lbtInit.modals();},addGalleryToGalleryList:function(data){$('.gallery_navigation_container').html(data.nav);$('#image_list_container').html(data.html);$.modal.close();$('#displayAllImages').removeClass('current_gallery');$('#gallery_list li').removeClass('current_gallery');$('#gallery_list li[id='+data.new_gallery_id+']').addClass('current_gallery');lbtInit.modals();},updateGalleryListAfterReanme:function(data){$('.gallery_navigation_container').html(data.nav);$.modal.close();$('#gallery_list li[id='+data.current_gallery_id+']').addClass('current_gallery');lbtInit.modals();},galleryChooserInit:function(){$('#gallery_list li').mouseover(function(){$(this).addClass('hover_gallery');});$('#gallery_list li').mouseout(function(){$(this).removeClass('hover_gallery');});$('#gallery_list li').click(function(event){event.preventDefault();$('#displayAllImages').removeClass('current_gallery');$('#gallery_list li').removeClass('current_gallery');$(this).addClass('current_gallery');$.post("/galleries/displayImagesForSelection",{gallery_id:$(this).attr('id'),story_id:$('#gallery_upload_container #story_id').val(),story_page_id:$('#gallery_upload_container #story_page_id').val()},function(data){$('#image_list_container').html(data.html);$('#gallery_id').val(data.gallery_id);lbtInit.modals();},"json");});$('#displayAllImages').click(function(event){event.preventDefault();$('#gallery_list li').removeClass('current_gallery');$(this).addClass('current_gallery');$.post("/galleries/displayAllImagesForSelection",{user_id:$('#user_id').val()},function(data){$('#image_list_container').html(data.html);},"json");});lbt.showLastUsedGallery();},showLastUsedGallery:function(){if($('#gallery_list li').length>0)
{if($('#show_last_used_gallery').val())
{var gallery_id=$('#last_used_gallery').val();if(gallery_id=="displayAllImages")
{$('#'+gallery_id+'').trigger('click');}
else
{$('#gallery_list li[id='+gallery_id+']').trigger('click');}}}
else
{$('#displayAllImages').trigger('click');}},galleryImagesDisplayedForSelecting:function()
{},finishCoverSelection:function(id,title,author,src,paths){$.modal.close();$('input[name=story_id][value!='+id+']').val(id);$('#storyCover').attr('src',src);var href=$('a.artPadModal').attr('href');href=href.replace(/\?.*/,'');href+='?story_id='+id+'&image='+$.trim(paths[0]);$('a.artPadModal').attr('href',href);href=$('a.storyCover').attr('href');href=href.replace(/\?.*/,'');href+='?image='+$.trim(paths[0]);$('a.storyCover').attr('href',href);$('#image_file').val($.trim(paths[0]));$('#image_file_med').val($.trim(paths[1]));$('#image_file_sml').val($.trim(paths[2]));if($('#title').val()=='')
$('#title').val(title);if($('#author').val()=='')
$('#author').val(author);$('.errorMsgs').remove();},finishCoverSelectionFromEditor:function(id,src,paths){$.modal.close();$('input[name=story_id][value!='+id+']').val(id);$('#storyCover').attr('src',src);var href=$('a.artPadModal').attr('href');href=href.replace(/\?.*/,'');href+='?story_id='+id+'&image='+$.trim(paths[0]);$('a.artPadModal').attr('href',href);href=$('a.storyCover').attr('href');href=href.replace(/\?.*/,'');href+='?image='+$.trim(paths[0]);$('a.storyCover').attr('href',href);$('#image_file').val($.trim(paths[0]));$('#image_file_med').val($.trim(paths[1]));$('#image_file_sml').val($.trim(paths[2]));$('.errorMsgs').remove();},finishPageSelection:function(id,src,paths){$.modal.close();$('input[name=story_page_id][value!='+id+']').val(id);$('#storyPageImage').attr('src',src);var href=$('a.artPadModal').attr('href');href=href.replace(/\?.*/,'');href+='?story_page_id='+id+'&image='+$.trim(paths[0]);$('a.artPadModal').attr('href',href);href=$('a.storyPageImage').attr('href');href=href.replace(/\?.*/,'');href+='?image='+$.trim(paths[0]);$('a.storyPageImage').attr('href',href);$('#image_file').val($.trim(paths[0]));$('#image_file_med').val($.trim(paths[1]));$('#image_file_sml').val($.trim(paths[2]));buttons.savePage();$('.errorMsgs').remove();},bindEditProtect:function(e){if(e)e.preventDefault();buttons.savePage();$('a').not('[href=#]').not('[target]').not('.'+JQB+'EditProtect').not('.popModal').not('.artPadModal').not('.modalClose').not('.galleryChooserModal').click(function(e){var a=this;e.preventDefault();$.promptModal('You have unsaved changes!! Are you sure you want to remove them?',{onSubmit:function(){window.location=a.href;}});}).addClass(JQB+'EditProtect');}};var lbtArtPad={init:function(){},saveImage:function(path_to_tmp_image,story_id,page_id){}};var buttons={deleteContact:function(){if($('input.checkMe:checked').size()>0){$('.deleteCheckedDiv input').removeClass('hiddenButtonDisabled').addClass('hiddenButton').removeAttr('disabled');$('.deleteCheckedDiv a').removeClass('disabled');$('.deleteCheckedDiv div').removeClass('deleteCheckedNa').addClass('deleteCheckedOff');}else{$('.deleteCheckedDiv input').removeClass('hiddenButton').addClass('hiddenButtonDisabled').attr('disabled','disabled');$('.deleteCheckedDiv a').addClass('disabled');$('.deleteCheckedDiv div').removeClass('deleteCheckedOff').addClass('deleteCheckedNa');}},savePage:function(){$('.savePageDiv input').removeClass('hiddenButtonDisabled').addClass('hiddenButton').removeAttr('disabled');$('.savePageDiv a').removeClass('disabled');$('.savePageDiv div').removeClass('savePageNa').addClass('savePageOn');}}
var lbtInit={init:function(){lbtInit.ajax();lbtInit.backgrounds();lbtInit.captcha();lbtInit.modals();lbtInit.links();lbtInit.forms();lbtInit.inlineEditors();lbtInit.fileUpload();lbtInit.richTextEditor();lbtInit.audio();},ajax:function(){$.ajaxLoader();},backgrounds:function(){$('.bg9').bg9();},fileUpload:function(){$.fileUpload({progressUrl:'/home/uploadProgress/'});},richTextEditor:function(){$('.rte').keyup(buttons.savePage);},audio:function(){if($('#audioRecorderControl').size()>0){$.audioRecorder({fileExists:$('#audio_file').val()?true:false,onLoad:function(){if($.browser.safari)
$('#recLevel').remove();},onMicActivity:function(code,level){$('#recLevel span').css('width',level+'%');},beforeRecord:function(){lbt.bindEditProtect();this.setFile($('#audio_file_tmp').val().replace('.flv',''));},onRecord:function(){$('#recordingIndicator').show();buttons.savePage();},onRecordStop:function(){$('#recLevel span').css('width',0);$('#recordingIndicator').hide();}});}
if($('#audioPlayerControl').size()>0){$.audioRecorder({idControl:'audioPlayerControl',idFlash:'audioPlayer',onConnect:function(){this.play();},onPlayEnd:function(){$('a.next').each(function(){window.location=this.href;});},onPlayTime:function(code,now,total){total=isNaN(total)?0:total;var min=Math.floor(now/60);var sec=Math.round(now%60);if(sec<10)sec='0'+sec;$('#playTime .timeNow').text(min+'.'+sec);min=Math.floor(total/60);sec=Math.round(total%60);if(sec<10)sec='0'+sec;$('#playTime .timeTotal').text(min+'.'+sec);}});}},links:function(){$('a.disabled').not('.'+JQB).click(function(e){e.preventDefault();}).addClass(JQB);$('a.saveTitleFirst').not('.'+JQB).click(function(e){if($('#saveContinue-index-0').length>0)
{e.preventDefault();$('#saveContinue-index-0').trigger('click');}}).addClass(JQB);},captcha:function(){$('.captchaRefresh').not('.'+JQB).click(function(e){e.preventDefault();var a=this;$.getJSON(a.href,function(data){$('#'+data.id).attr('src',data.src);});}).addClass(JQB);},modals:function(){$.ajaxModal.defaults.autoCenter=true;$.ajaxModal.defaults.autoCenterTop=0.3;$('.popModal').ajaxModal({onShow:function(){lbtInit.modals();lbtInit.modalForms();}});$('.artPadModal').ajaxModal({windowClass:'artPadModalWindow'});$('.galleryChooserModal').ajaxModal({windowClass:'galleryChooserWindow',onShow:function(){lbt.galleryChooserInit();}});},forms:function(){$('label.overlabel').overlabel();setTimeout("$('#member_login #email,#member_login #password').focus().blur();$('#member_login #email').focus();",300);$('form.editProtect input, form.editProtect textarea').not('.'+JQB+'EditProtect').change(lbt.bindEditProtect).addClass(JQB+'EditProtect');$('input[name=button][value=Delete].confirmDelete').not('.'+JQB).click(function(e){var b=this;e.preventDefault();$.promptModal('Are you positive you want to REMOVE this?',{onSubmit:function(){$('<input type="hidden" name="'+b.name+'" id="'+b.id+'" value="'+b.value+'" />').appendTo(b.form);b.form.submit();}});}).addClass(JQB);$('.deleteDiv input').not('.'+JQB).click(function(e){var b=this;e.preventDefault();$.promptModal('Are you sure you want to DELETE this page?',{onSubmit:function(){$('<input type="hidden" name="'+b.name+'" id="'+b.id+'" value="'+b.value+'" />').appendTo(b.form);$('<input type="hidden" name="story_page_id" id="story_page_id" value="'+$('#story_page_id').val()+'" />').appendTo(b.form);b.form.submit();}});}).addClass(JQB);$('.deleteCheckedDiv input').not('.'+JQB).click(function(e){var b=this;e.preventDefault();if(b.disabled)
return false;$.promptModal('Are you sure you want to DELETE this contact?',{onSubmit:function(){$('<input type="hidden" name="'+b.name+'" id="'+b.id+'" value="'+b.value+'" />').appendTo(b.form);b.form.submit();}});}).addClass(JQB);$('a.confirmDelete').not('.inlineEdit').not('.'+JQB).click(function(e){var a=this;e.preventDefault();$.promptModal('Are you positive you want to REMOVE this?',{onSubmit:function(){window.location=a.href;}});}).addClass(JQB);$('a.confirmDeleteTale').not('.inlineEdit').not('.'+JQB).click(function(e){var a=this;e.preventDefault();$.promptModal('Are you positive you want to DELETE this tale?',{onSubmit:function(){window.location=a.href;}});}).addClass(JQB);$('.checkAll').checkAllMaster('.checkMe');$('#delete_contacts input.checkAll, #delete_contacts input.checkMe').click(buttons.deleteContact);},inlineEditors:function(){$('a.privateToggle').click(function(e){e.preventDefault();var a=this;var confirmed=confirm('Requesting your tale to be made public means that, if approved, it will appear on our Public Tales page. Any visitor to our site can view Public Tales. You do not need to make a tale public to share with others.\n\nIn order to be displayed on our Public Tales page, your tale needs to meet the following criteria:\n\n1. Content should be appropriate for young children.\n\n2. Have a minimum of 3 pages.\n\n3. Each page, including title, needs to have an image.\n\n4. Each page needs to have text and/or audio.\n\n5. May not contain any copywritten material.\n\nDo you still want to request for this tale be made public?');if(confirmed)
{$.get(a.href,function(data){if(data.error)
{alert(data.error);}
else
{var v=$(a).parents('.inlineEdit').eq(0);v.not('.noRemove').hide();v.before(data.html);v.not('.noRemove').remove();lbtInit.inlineEditors();}},"json");}});$('a.inlineEdit').not('.'+JQB).click(function(e){e.preventDefault();var a=this;var v=$(a).parents('.inlineEdit').eq(0);if($(a).hasClass('confirmDelete')){$.promptModal('Are you positive you want to REMOVE this?',{onSubmit:function(){$.post(a.href,function(data){v.remove();lbtInit.inlineEditors();});}});}else{$.get(a.href,function(data){v.not('.noRemove').hide();if(v.hasClass('after'))
v.after(data);else
v.before(data);v.not('.noRemove').remove();lbtInit.inlineEditors();});}}).addClass(JQB);$('form.inlineEdit :submit').not('.'+JQB).click(function(e){var b=this;var f=$(b.form);if(f.find(':file').size()){return;}
e.preventDefault();var p=f.find(':input').serializeArray();p[p.length]={name:"button",value:b.value};$.post(f.attr('action'),p,function(data){f.not('.noRemove').hide();if(b.value!='Delete')
f.before(data);f.not('.noRemove').remove();lbtInit.inlineEditors();});}).addClass(JQB);},modalForms:function(){$('form.modalForm :submit').not('.'+JQB).click(function(e){e.preventDefault();var b=this;var f=$(b).parents('form.modalForm');var p=f.find(':input').serializeArray();p[p.length]={name:"button",value:b.value};$.post(f.attr('action'),p,function(data){f.parents('.modalData').hide().html(data).fadeIn(modalEffect.duration);$(window).resize();lbtInit.modalForms();});}).addClass(JQB);lbtInit.fileUpload();lbtInit.forms();},modalLinks:function(){$('a.replaceModal').not('.'+JQB).click(function(e){e.preventDefault();$.ajaxModal.replace(this.href);$.ajaxModal.bindCloseRefresh();}).addClass(JQB);}};if(typeof deconcept=="undefined")var deconcept={};if(typeof deconcept.util=="undefined")deconcept.util={};if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil={};deconcept.SWFObject=function(swf,id,w,h,ver,c,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.getElementById){return;}
this.DETECT_KEY=detectKey?detectKey:'detectflash';this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(swf){this.setAttribute('swf',swf);}
if(id){this.setAttribute('id',id);}
if(w){this.setAttribute('width',w);}
if(h){this.setAttribute('height',h);}
if(ver){this.setAttribute('version',new deconcept.PlayerVersion(ver.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);}
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}
if(c){this.addParam('bgcolor',c);}
var q=quality?quality:'high';this.addParam('quality',q);this.setAttribute('useExpressInstall',false);this.setAttribute('doExpressInstall',false);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');if(redirectUrl){this.setAttribute('redirectUrl',redirectUrl);}}
deconcept.SWFObject.prototype={useExpressInstall:function(path){this.xiSWFPath=!path?"expressinstall.swf":path;this.setAttribute('useExpressInstall',true);},setAttribute:function(name,value){this.attributes[name]=value;},getAttribute:function(name){return this.attributes[name]||"";},addParam:function(name,value){this.params[name]=value;},getParams:function(){return this.params;},addVariable:function(name,value){this.variables[name]=value;},getVariable:function(name){return this.variables[name]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var variablePairs=[];var key;var variables=this.getVariables();for(key in variables){variablePairs[variablePairs.length]=key+"="+variables[key];}
return variablePairs;},getSWFHTML:function(){var swfNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute('swf',this.xiSWFPath);}
swfNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute('swf')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+(this.getAttribute('style')||"")+'"';swfNode+=' id="'+this.getAttribute('id')+'" name="'+this.getAttribute('id')+'" ';var params=this.getParams();for(var key in params){swfNode+=[key]+'="'+params[key]+'" ';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='flashvars="'+pairs+'"';}
swfNode+='/>';}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute('swf',this.xiSWFPath);}
swfNode='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+(this.getAttribute('style')||"")+'">';swfNode+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var params=this.getParams();for(var key in params){swfNode+='<param name="'+key+'" value="'+params[key]+'" />';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />';}
swfNode+="</object>";}
return swfNode;},write:function(elementId){if(this.getAttribute('useExpressInstall')){var expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){this.setAttribute('doExpressInstall',true);this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){var n=(typeof elementId=='string')?document.getElementById(elementId):elementId;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute('redirectUrl')!=""){document.location.replace(this.getAttribute('redirectUrl'));}}
return false;}}
deconcept.SWFObjectUtil.getPlayerVersion=function(){var PlayerVersion=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){PlayerVersion=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var counter=3;while(axo){try{counter++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+counter);PlayerVersion=new deconcept.PlayerVersion([counter,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");PlayerVersion=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(PlayerVersion.major==6){return PlayerVersion;}}
try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}
if(axo!=null){PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return PlayerVersion;}
deconcept.PlayerVersion=function(arrVersion){this.major=arrVersion[0]!=null?parseInt(arrVersion[0]):0;this.minor=arrVersion[1]!=null?parseInt(arrVersion[1]):0;this.rev=arrVersion[2]!=null?parseInt(arrVersion[2]):0;}
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major)return false;if(this.major>fv.major)return true;if(this.minor<fv.minor)return false;if(this.minor>fv.minor)return true;if(this.rev<fv.rev)return false;return true;}
deconcept.util={getRequestParameter:function(param){var q=document.location.search||document.location.hash;if(param==null){return q;}
if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1));}}}
return"";}}
deconcept.SWFObjectUtil.cleanupSWFs=function(){var objects=document.getElementsByTagName("OBJECT");for(var i=objects.length-1;i>=0;i--){objects[i].style.display='none';for(var x in objects[i]){if(typeof objects[i][x]=='function'){objects[i][x]=function(){};}}}}
if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];}}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

